{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {
    "pycharm": {
     "is_executing": false
    }
   },
   "outputs": [],
   "source": [
    "#加载数据\n",
    "import pandas as pd\n",
    "data = pd.read_csv(\"generated_data.csv\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {
    "pycharm": {
     "is_executing": false
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": "   x   y\n0  1   7\n1  2   9\n2  3  11\n3  4  13\n4  5  15",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>x</th>\n      <th>y</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>1</td>\n      <td>7</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>2</td>\n      <td>9</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>3</td>\n      <td>11</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>4</td>\n      <td>13</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>5</td>\n      <td>15</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 32
    }
   ],
   "source": [
    "data.head()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {
    "pycharm": {
     "is_executing": false
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "text": [
      "<class 'pandas.core.frame.DataFrame'> (10, 2)\n"
     ],
     "output_type": "stream"
    }
   ],
   "source": [
    "print(type(data),data.shape)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {
    "pycharm": {
     "is_executing": false
    }
   },
   "outputs": [],
   "source": [
    "x = data.loc[ : , 'x']\n",
    "y = data.loc[ : , 'y']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {
    "pycharm": {
     "is_executing": false
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "text": [
      "0     1\n",
      "1     2\n",
      "2     3\n",
      "3     4\n",
      "4     5\n",
      "5     6\n",
      "6     7\n",
      "7     8\n",
      "8     9\n",
      "9    10\n",
      "Name: x, dtype: int64 0     7\n",
      "1     9\n",
      "2    11\n",
      "3    13\n",
      "4    15\n",
      "5    17\n",
      "6    19\n",
      "7    21\n",
      "8    23\n",
      "9    25\n",
      "Name: y, dtype: int64\n"
     ],
     "output_type": "stream"
    }
   ],
   "source": [
    "print(x,y)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 展示"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {
    "pycharm": {
     "is_executing": false
    }
   },
   "outputs": [],
   "source": [
    "from matplotlib import pyplot as plt\n",
    "plt.figure(figsize =(10,10))\n",
    "plt.scatter(x,y)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 预测"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {
    "pycharm": {
     "is_executing": false
    }
   },
   "outputs": [],
   "source": [
    "from sklearn.linear_model import LinearRegression\n",
    "lr_model = LinearRegression()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {
    "pycharm": {
     "is_executing": false
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "text": [
      "<class 'numpy.ndarray'> (10, 1)\n",
      "<class 'numpy.ndarray'> (10, 1)\n"
     ],
     "output_type": "stream"
    }
   ],
   "source": [
    "#转换数据 维度\n",
    "import numpy as np\n",
    "x = np.array(x)\n",
    "x = x.reshape(-1,1)\n",
    "y = np.array(y)\n",
    "y = y.reshape(-1,1)\n",
    "print(type(x),x.shape)\n",
    "print(type(y),y.shape)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {
    "pycharm": {
     "is_executing": false
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": "LinearRegression()"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 40
    }
   ],
   "source": [
    "#训练模型\n",
    "\n",
    "lr_model.fit(x,y)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {
    "pycharm": {
     "is_executing": false
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "text": [
      "[[ 7.]\n",
      " [ 9.]\n",
      " [11.]\n",
      " [13.]\n",
      " [15.]\n",
      " [17.]\n",
      " [19.]\n",
      " [21.]\n",
      " [23.]\n",
      " [25.]]\n"
     ],
     "output_type": "stream"
    }
   ],
   "source": [
    "#预测结果\n",
    "y_predict = lr_model.predict(x)\n",
    "print(y_predict)\n",
    "#结果跟Y一样的"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {
    "pycharm": {
     "is_executing": false
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "text": [
      "[[12.]]\n"
     ],
     "output_type": "stream"
    }
   ],
   "source": [
    "y_3 = lr_model.predict( [[3.5]]  )\n",
    "print(y_3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {
    "pycharm": {
     "is_executing": false
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "text": [
      "[[2.]] [5.]\n"
     ],
     "output_type": "stream"
    }
   ],
   "source": [
    "#打印a b\n",
    "a = lr_model.coef_\n",
    "b = lr_model.intercept_\n",
    "print(a,b)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {
    "pycharm": {
     "is_executing": false
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "text": [
      "1.4909471108677122e-29 1.0\n"
     ],
     "output_type": "stream"
    }
   ],
   "source": [
    "#评估模型表现\n",
    "from  sklearn.metrics import mean_squared_error,r2_score\n",
    "MSE = mean_squared_error(y,y_predict)\n",
    "R2 = r2_score(y,y_predict)\n",
    "print(MSE,R2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {
    "pycharm": {
     "is_executing": false
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": "<Figure size 432x288 with 1 Axes>",
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD4CAYAAADiry33AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAgAElEQVR4nO3dd3xUdb7/8deH3nsvMfRe1AAq9opYEd1FvXYX3bveu/52V4kdO3a3uCooll3rEhBEVMDepSyk0DshkNATCCHt8/sjs/fmsjMQkklmMnk/H4885sw53zPnMycn75yczHzG3B0REYldtSJdgIiIVC4FvYhIjFPQi4jEOAW9iEiMU9CLiMS4OpEuIJg2bdp4fHx8pMsQEak2Fi1atMPd2wZbFpVBHx8fz8KFCyNdhohItWFmG0Mt06UbEZEYp6AXEYlxCnoRkRinoBcRiXEKehGRGHfEoDezrmb2hZktN7M0M/ttYP5EM9tiZksCX6NDrD/KzFaa2RozSwz3ExARkcMry8srC4Hfu/tiM2sKLDKzeYFlz7n706FWNLPawAvAOUA6sMDMZrn7sooWLiIiZXPEM3p33+ruiwPTOcByoHMZH384sMbd17l7PvAucEl5ixURiVULNuzipa/WVspjH9U1ejOLB44FfgrMus3Mks1sqpm1DLJKZ2BzqfvphPglYWbjzWyhmS3cvn370ZQlIlJt7TtYyP0zU7nipR94+6dN5OYXhn0bZQ56M2sCJAG3u3s28CLQAxgKbAWeCbZakHlBP+nE3Se7e4K7J7RtG/RdvCIiMeXLlVmc99zX/O3HjdwwMp6Pf3sKjeqFv2FBmR7RzOpSEvJvuft0AHfPLLV8CjA7yKrpQNdS97sAGeWuVkQkBuzen8/DHy1j+uIt9GzXhGm3nsTxxw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/Bn4uXgWWu/uzpRZF1XEaqs5oPEYPU2vVHKdV8R/nSHwBjSgJ7ual5t0K3BqYvg1Io+Q/2D8CJ1VRXe9Q8idaASW/qW8CWgOfAasDt60CYzsBc0qtO5qS/9avBe6JUK1rKLleuCTw9dKhtVLy6oClga+0yq41RJ1/A1KA5MAPRcdI79NgdQbmv/6v47LU2Ejuz5MpuTSQXOr7PDrajtPD1BmNx2ioWqvkOFULBBGRGBfrl25ERGo8Bb2ISIxT0IuIxDgFvYhIjFPQi4jEOAW9iEiMU9CLiMS4/w883vXxx9FcTQAAAABJRU5ErkJggg==\n"
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "#直接画图\n",
    "plt.figure()\n",
    "plt.plot(y,y_predict)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {
    "pycharm": {
     "is_executing": false
    }
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "name": "pycharm-bd849f12",
   "language": "python",
   "display_name": "PyCharm (Learning)"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.7"
  },
  "pycharm": {
   "stem_cell": {
    "cell_type": "raw",
    "source": [],
    "metadata": {
     "collapsed": false
    }
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}